package com.isay.app.honey.manager;

import com.isay.frameworklib.okhttp.BaseHttpManager;
import com.isay.frameworklib.okhttp.ICommonCallback;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by cywu4 on 2018/12/17.
 */
public class NetworkManager extends BaseHttpManager {

    /**
     * 注册
     */
    public static void register(String username, String invitecode, String password, String repassword, ICommonCallback callback) {
        Map<String, Object> map = new HashMap<>();
        map.put("username", username);
        map.put("invitecode", invitecode);
        map.put("password", password);
        map.put("repassword", repassword);
        post(AppUrl.REGISTER, map, "register", callback);
    }


    public static void login(String username, String password, ICommonCallback callback) {
        Map<String, Object> map = new HashMap<>();
        map.put("username", username);
        map.put("password", password);
        post(AppUrl.LOGIN, map, "login", callback);
    }

    public static void forgetPwd(String username, String password, String repassword, ICommonCallback callback) {
        Map<String, Object> map = new HashMap<>();
        map.put("username", username);
        map.put("password", password);
        map.put("repassword", repassword);
        post(AppUrl.FORGET, map, "forgetPwd", callback);
    }

    //邀请好友
    public static void invite(ICommonCallback callback) {
        post(AppUrl.INVITE, null, "invite", callback);
    }

    public static void modifyPwd(String oldpassword, String password, String repassword, ICommonCallback callback) {
        Map<String, Object> map = new HashMap<>();
        map.put("oldpassword", oldpassword);
        map.put("password", password);
        map.put("repassword", repassword);
        post(AppUrl.MODIFY_PWD, map, "modifyPwd", callback);
    }


    public static void userCenter(ICommonCallback callback) {
        post(AppUrl.USER_CENTER, null, "userCenter", callback);
    }

    public static void home(ICommonCallback callback) {
        post(AppUrl.HOME, null, "home", callback);
    }

    public static void homeDirect(ICommonCallback callback) {
        post(AppUrl.HOME_DIRECT, null, "homeDirect", callback);
    }

    public static void homeClound(ICommonCallback callback) {
        post(AppUrl.HOME_CLOUND, null, "homeClound", callback);
    }

    public static void splash(ICommonCallback callback) {
        post(AppUrl.SPLASH, null, "splash", callback);
    }

    public static void inGame(ICommonCallback callback) {
        post(AppUrl.PLAY_GAME, null, "startGame", callback);
    }

    public static void startGame(ICommonCallback callback) {
        post(AppUrl.START_GAME, null, "startGame", callback);
    }


    public static void stopGame(ICommonCallback callback) {
        post(AppUrl.STOP_GAME, null, "stopGame", callback);
    }



    public static void cashManager(ICommonCallback callback) {
        post(AppUrl.CASH_MANAGER, null, "cashManager", callback);
    }

    public static void cashHistory(ICommonCallback callback) {
        post(AppUrl.CASH_HISTORY, null, "cashHistory", callback);
    }

    public static void getCanCash(ICommonCallback callback) {
        post(AppUrl.CASH_CAN, null, "getCanCash", callback);
    }

    public static void getCash(String inPutMoney, ICommonCallback callback) {
        Map<String, Object> map = new HashMap<>();
        map.put("money", inPutMoney);
        post(AppUrl.CASH_GET, map, "getCash", callback);
    }

    public static void setBankCode(String name, String bankCode, ICommonCallback callback) {
        Map<String, Object> map = new HashMap<>();
        map.put("name", name);
        map.put("bankcode", bankCode);
        post(AppUrl.SET_BANK_CODE, map, "setBankCode", callback);
    }

    public static void getMyProfit(String starttime, String endtime, ICommonCallback callback) {
        Map<String, Object> map = new HashMap<>();
        map.put("starttime", starttime);
        map.put("endtime", endtime);
        post(AppUrl.GET_PROFIT, map, "getMyProfit", callback);
    }
}
